package com.wxmp.userwechat.domain;

import java.io.Serializable;
import java.sql.Timestamp;

import me.chanjar.weixin.cp.bean.WxCpUser;

/**
 * -
 * @author hexgon
 * @email 
 * @url 
 * @date 2019年4月15日 上午11:05:58
 */
public class SysUserCpWechatEntity implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	/**
	 * 自增主键
	 */
	private Long id;
	
	/**
	 * 用户id
	 */
	private Long userId;
	
	/**
	 * 微信用户id
	 */
	private String wxUserId;
	
	/**
	 * 用户名称
	 */
	private String wxName;
	
	/**
	 * 手机
	 */
	private String mobile;
	
	/**
	 * 部门
	 */
	private String department;
	
	/**
	 * 排序
	 */
	private Integer wxOrder;
	
	/**
	 * 职位
	 */
	private String wxPosition;
	
	/**
	 * 姓别
	 */
	private String gender;
	
	/**
	 * 邮箱
	 */
	private String email;
	
	/**
	 * 是否部门主管
	 */
	private String isLeaderInDept;
	
	/**
	 * 头像
	 */
	private String avatar;
	
	/**
	 * 座机
	 */
	private String telephone;
	
	/**
	 * 启用状态
	 */
	private String enable;
	
	/**
	 * 别名
	 */
	private String wxAlias;
	
	/**
	 * 状态
	 */
	private String status;
	
	/**
	 * 扩展属性
	 */
	private String extattr;
	
	/**
	 * 二维码
	 */
	private String qrCode;
	
	/**
	 * 
	 */
	private String externalProfile;
	
	/**
	 * 
	 */
	private String externalPosition;
	
	/**
	 * 地址
	 */
	private String address;
	
	/**
	 * 创建时间
	 */
	private Timestamp createTime;
	
	/**
	 * 修改时间
	 */
	private Timestamp updateTime;
	

	public SysUserCpWechatEntity() {
		super();
	}
	public SysUserCpWechatEntity(WxCpUser wxCpUser) {
		this.wxUserId = wxCpUser.getUserId() ;
		this.wxName = wxCpUser.getName();
		this.mobile = wxCpUser.getMobile();
		String departIds = "";
		for (Long departid : wxCpUser.getDepartIds()) {
			departIds+=departid+",";
		}
		this.department = departIds;
		this.wxPosition = wxCpUser.getPosition();
		String gender = "0";
		if(wxCpUser.getGender()!=null) {
			gender = wxCpUser.getGender().getCode();
		}
		this.gender = gender;
		this.email = wxCpUser.getEmail();
		this.isLeaderInDept = String.valueOf(wxCpUser.getIsLeader());
		this.avatar = wxCpUser.getAvatar();
		this.telephone = wxCpUser.getTelephone();
		this.enable = String.valueOf(wxCpUser.getEnable());
		this.status = String.valueOf(wxCpUser.getStatus());
		this.qrCode = wxCpUser.getQrCode();
		
		
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	public Long getId() {
		return id;
	}
	
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	
	public Long getUserId() {
		return userId;
	}
	
	public void setWxUserId(String wxUserId) {
		this.wxUserId = wxUserId;
	}
	
	public String getWxUserId() {
		return wxUserId;
	}
	
	public void setWxName(String wxName) {
		this.wxName = wxName;
	}
	
	public String getWxName() {
		return wxName;
	}
	
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	public String getMobile() {
		return mobile;
	}
	
	public void setDepartment(String department) {
		this.department = department;
	}
	
	public String getDepartment() {
		return department;
	}
	
	public void setWxOrder(Integer wxOrder) {
		this.wxOrder = wxOrder;
	}
	
	public Integer getWxOrder() {
		return wxOrder;
	}
	
	public void setWxPosition(String wxPosition) {
		this.wxPosition = wxPosition;
	}
	
	public String getWxPosition() {
		return wxPosition;
	}
	
	public void setGender(String gender) {
		this.gender = gender;
	}
	
	public String getGender() {
		return gender;
	}
	
	public void setEmail(String email) {
		this.email = email;
	}
	
	public String getEmail() {
		return email;
	}
	
	public void setIsLeaderInDept(String isLeaderInDept) {
		this.isLeaderInDept = isLeaderInDept;
	}
	
	public String getIsLeaderInDept() {
		return isLeaderInDept;
	}
	
	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}
	
	public String getAvatar() {
		return avatar;
	}
	
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	
	public String getTelephone() {
		return telephone;
	}
	
	public void setEnable(String enable) {
		this.enable = enable;
	}
	
	public String getEnable() {
		return enable;
	}
	
	public void setWxAlias(String wxAlias) {
		this.wxAlias = wxAlias;
	}
	
	public String getWxAlias() {
		return wxAlias;
	}
	
	public void setStatus(String status) {
		this.status = status;
	}
	
	public String getStatus() {
		return status;
	}
	
	public void setExtattr(String extattr) {
		this.extattr = extattr;
	}
	
	public String getExtattr() {
		return extattr;
	}
	
	public void setQrCode(String qrCode) {
		this.qrCode = qrCode;
	}
	
	public String getQrCode() {
		return qrCode;
	}
	
	public void setExternalProfile(String externalProfile) {
		this.externalProfile = externalProfile;
	}
	
	public String getExternalProfile() {
		return externalProfile;
	}
	
	public void setExternalPosition(String externalPosition) {
		this.externalPosition = externalPosition;
	}
	
	public String getExternalPosition() {
		return externalPosition;
	}
	
	public void setAddress(String address) {
		this.address = address;
	}
	
	public String getAddress() {
		return address;
	}
	
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	
	public Timestamp getCreateTime() {
		return createTime;
	}
	
	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}
	
	public Timestamp getUpdateTime() {
		return updateTime;
	}
	public static void main(String[] args) {
		Integer[] aaa = {1,2,23,45};
		String departIds = "";
		for (Integer departid : aaa) {
			departIds+=departid+",";
		}
		System.out.println(departIds);
	}
}
